﻿namespace XUHttpDownload
{
    /// <summary>
    /// 封装http请求
    /// </summary>
    public class XUHttpSocketRequest
    {
        public byte[] tempBuffer;
        public byte[] fileBuffer;

        public int fileLength;
        public int fileOffset;

        public string requestHeader;
        public string responseHeader;

        public enum Status
        {
            None,
            Ready,
            Request,
            Response,
            Cancel,
        }
        public Status status = Status.Ready;

        public XUHttpSocketRequest(int recvBuffSize, int fileBuffSize)
        {
            tempBuffer = new byte[recvBuffSize];
            fileBuffer = new byte[fileBuffSize];
        }

        public void Reset()
        {
            fileLength = 0;
            fileOffset = 0;

            requestHeader = string.Empty;
            responseHeader = string.Empty;

            status = Status.None;
        }
    }
}